package org.awa.demo.opencv.controller;

import lombok.Getter;
import org.awa.demo.opencv.service.IOpenCvService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author xxf
 */
@RestController
public class OpenCvController {

    @Autowired
    private IOpenCvService openCvService;

    /**
     * 录音上传
     * @return
     */
    @PostMapping
    @ResponseBody
    public String send(@RequestParam("file") MultipartFile file) {
        try {
            if (file.isEmpty()) {
                return "文件为空,请选择你的文件上传";
            }
            openCvService.hasFace(file);
        } catch (Exception e) {
            e.printStackTrace();
            return e.toString();
        }
        return "OK";
    }

}
